package com.dy.design_pattern_study.state_pattern.dome3.impl;

import com.dy.design_pattern_study.state_pattern.dome3.State;
import com.dy.design_pattern_study.state_pattern.dome3.entry.Work;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-06
 * @Content 下午状态
 */
public class AfternoonState extends State {
    @Override
    public void writeProgram(Work work) {
        if (work.getHour() < 17) {
            System.out.println("下午工作，当前时间： = " + work.getHour());
        }else {
            //超过 17 点，就进入 晚上 状态
            work.setState(new EveningState());
            work.writeProgram();
        }
    }
}
